<?php
/**
 * 功能: PhpStorm.
 * User: 文丹
 * Date: 2018/8/10 0010
 * Time: 14:38
 */

namespace app\validate;
use app\validate\BaseValidate;
class Positive extends BaseValidate{
    protected $rule = [
        'amount'=>'require|number|positive',
    ];
    public function positive($value,$rule='',$data='',$field=''){
        if(($value+0)>0 ){
            return true;
        }else{
            return $field.'必须为正数数字';
           /*$error = $field.'必须为正数数字';
            return json(['msg'=>$error,'ok'=>false]);*/
        }
    }
}